package com.hzp.controller;

import com.hzp.entity.Dept;
import com.hzp.service.DeptClientService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/consumer/feign/dept")
public class ConsumerFeignDeptController {

    @Resource
    private DeptClientService deptClientService;

    @GetMapping("/list")
    public List<Dept> listDept(){
        return deptClientService.listDept();
    }

    @GetMapping("/get/{id}")
    public Dept getDept(@PathVariable("id") Integer id){
        return deptClientService.getDept(id);
    }

    @PostMapping("/add")
    public boolean addDept(@RequestBody Dept dept){
        return deptClientService.addDept(dept);
    }

    @GetMapping("/get/timeout")
    public String getTimeout(){
        return deptClientService.getTimeout();
    }

}